<?php
class Orders extends MY_Admin_Controller{
	var $folder = "admin";
	function __construct(){
		parent::__construct();
		$this->load->model('admin/Orders_model' , 'mOrders' ,TRUE);
     	$this->load->model('admin/Order_details_model' , 'mOrderDetails' ,TRUE);
     	$this->load->model('admin/Item_section_model' , 'mItemSection' ,TRUE);
		
     	$this->mainmodel = $this->mOrders;
		//$this->load->model();
		$this->postConstructor();
	}
	
	
 
	function loadCustomReferenceData($data = array()){
		
		if(isset($data['ID'])){
			$this->mOrderDetails->db->select("item_section_id as real_item_section_id");
		 	$data['order_details'] = $this->mOrderDetails->mainListWithPaginationByField('orders_id' , $data['ID']);
			$data['ITEMSECTIONLIST'] = $this->mItemSection->mainListWithPaginationByField("item_id" , $data['record']['item_id']);
		}
		 return $data;
	}
}
?>